DISCUSSION
The
ATSUSetTransientFontMatching function provides automatic font substitution when a character(s) cannot be drawn with the assigned font. Like
ATSUMatchFontsToText,
ATSUSetTransientFontMatching uses the default search behavior of scanning all valid fonts on the user's system for a substitute font.
When it performs the substitution,
ATSUSetTransientFontMatching does not change the font attribute in the style object. As a result, if you plan to redraw a text layout object, you should instead call the function
ATSUSetFontFallbacks or
ATSUMatchFontsToText.
To ensure that the last resort font will be used if no other fonts are found, you can either call
ATSUSetTransientFontMatching or pass the
kATSUSequentialFallbacksExclusive constant in the
iFontFallbackMethod parameter of
ATSUSetFontFallbacks. If you do not set the last resort font, glyphs will be denoted by black boxes when a font is not installed on the user's system.